<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
  <!-- Bootstrap 3.3.6 -->
  <link rel="stylesheet" href="/static/adminlte/bootstrap/css/bootstrap.min.css">
  <!-- Font Awesome -->
  <link rel="stylesheet" href="/static/css/font-awesome.min.css">
  <!-- Ionicons -->
  <link rel="stylesheet" type="text/css" href="/static/css/ionicons.min.css" />
  <link rel="stylesheet" href="/static/bootstrap-datetimepicker-master/css/bootstrap-datetimepicker.min.css">  
  <!-- Theme style -->
  <link rel="stylesheet" href="/static/adminlte/dist/css/AdminLTE.min.css">
		<title></title>
	</head>
	<body>

<section class="content-header">
      <h1>商品管理<small>Goods</small></h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 后台管理</a></li>
        <li><a href="#">商城管理</a></li>
        <li class="active">商品管理</li>
      </ol>
</section>
<hr />

<section class="content">
			<div class="row">
				<form action="" id="search-form2" class="navbar-form form-inline" method="post" onsubmit="return false">
					<div class="form-group">
						<select name="cat_id" id="cat_id" class="form-control">
							<option value="">所有分类</option>
							<option value="779"> 0-2岁</option>
						</select>
					</div>

					<div class="form-group">
						<select name="is_on_sale" id="is_on_sale" class="form-control">
							<option value="">全部</option>
							<option value="1">上架</option>
							<option value="0">下架</option>
						</select>
					</div>
					<div class="form-group">
						<select name="intro" class="form-control">
							<option value="0">全部</option>
							<option value="is_new">新品</option>
							<option value="is_recommend">推荐</option>
						</select>
					</div>

					<div class="form-group">
						<label class="control-label" for="input-order-id">关键词</label>
						<div class="input-group">
							<input type="text" name="key_word" value="" placeholder="搜索词" id="input-order-id" class="form-control">
						</div>
					</div>
					<!--排序规则-->
					<button type="submit" id="button-filter search-order" class="btn btn-primary">
					<i class="fa fa-search"></i> 筛选
					</button>
					<a type="button" href="{{ route('admin.goods.add') }}" class="btn btn-primary">
						<i class="fa fa-plus"></i>添加新商品
					</a>
				</form>
				<hr />
			</div>
			<!--/.row -->

			<div class="row">
				<div class="col-xs-12">
					<table class="table table-hover">
						<thead>
							<tr>
								<th class="hidden-xs">
									<input  type="checkbox" value="">
								</th>
								<th>ID</th>
								<th>商品名称</th>
								<th>分类</th>
								<th>价格</th>
								<th>成本</th>
								<th>状态</th>
								<th>排序</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							@foreach($goods_list as $v)
							<tr>
								<td>
									<input  type="checkbox" value="">
								</td>
								<td>{{ $v['goods_id'] }}</td>
								<td>{{ $v['goods_name'] }}</td>
								<td>{{ $v['cat_id'] }}</td>
								<td>{{ $v['shop_price'] }}</td>
								<td>{{ $v['cost_price'] }}</td>
								<td> @if($v['is_on_sale']===1)
									<a href="{{ route('admin.goods.onsale',['goods_id'=>$v['goods_id'],'is_on_sale'=>-1]) }}" class="label label-warning ajax-a">
										下架
									</a> @elseif($v['is_on_sale']===-1)
									<a href="{{ route('admin.goods.onsale',['goods_id'=>$v['goods_id'],'is_on_sale'=>1]) }}" class="label label-success ajax-a">
										上架
									</a> @endif </td>
								<td>{{ $v['sort'] }}</td>
								<td>
									<a href="{{ route('admin.goods.edit',['id'=>$v['goods_id']]) }}" class="label label-success">
										编辑
									</a>
									<a href="{{ route('admin.goods.del',['id'=>$v['goods_id']]) }}" class="label label-danger ajax-delete">
										删除
									</a></td>
							</tr>
							@endforeach
						</tbody>
					</table>
					{{ $goods_list->links() }}
				</div>
			</div><!--/.row-->

		</section>
<!-- jQuery 2.2.3 -->
<script src="/static/adminlte/plugins/jQuery/jquery-2.2.3.min.js"></script>
<script src="/static/js/jquery.form.js"></script>
<script src="/static/layer/layer.js" type="text/javascript" charset="utf-8"></script>
<!-- Bootstrap 3.3.6 -->
<script src="/static/adminlte/bootstrap/js/bootstrap.min.js"></script>
<script src="/static/bootstrap-datetimepicker-master/js/bootstrap-datetimepicker.min.js"></script>
<script src="/static/bootstrap-datetimepicker-master/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="/static/js/admin.js?1234"></script>
<script>
  $(function () {
  	
    //时间选择器 
    $('.times').datetimepicker({
        format: 'yyyy-mm-dd',
        language: 'zh-CN',
        minView: "month", //选择日期后，不会再跳转去选择时分秒
        todayBtn:  1,     //显示今日按钮
    	autoclose: 1,     //选中自动关闭

    });

  });
</script>
</body>
</html>
